//package com.wxq.order.config;
//
//import com.zaxxer.hikari.HikariDataSource;
//
//import io.seata.rm.datasource.DataSourceProxy;
//import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.util.StringUtils;
//
//import javax.sql.DataSource;
//
///**
// * @author Jim
// * @date 9:12 下午 2022/4/21
// * @description seata配置
// * @email:huwmz04153277@126.com
// */
//@Configuration
//public class SeataConfig {
//    @Bean
//    public DataSource dataSource(DataSourceProperties dataSourceProperties) {
//        HikariDataSource dataSource = dataSourceProperties.initializeDataSourceBuilder()
//                .type(HikariDataSource.class).build();
//        if (StringUtils.hasText(dataSourceProperties.getName())){
//            dataSource.setPoolName(dataSourceProperties.getName());
//        }
//        //返回srata代理数据源
//        return  new DataSourceProxy(dataSource);
//    }
//}
